
package com.punch.common.feign;


import com.punch.common.constant.ServiceNameConstants;
import com.punch.common.feign.fallback.FeignHolidayServiceFallbackFactory;
import com.punch.common.feign.fallback.FeignUserServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDate;
import java.util.List;


/**
 * 节假日远程调用
 */
@FeignClient(name = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = FeignHolidayServiceFallbackFactory.class, decode404 = true)
public interface FeignHolidayService {

    /**
     * 查找一定范围内的节假日
     *
     * @param startDay 开始日期
     * @param endDay   结束日期
     * @return 节假日
     */
    @GetMapping(value = "/holiday", produces = "application/json; charset=utf-8")
    List<LocalDate> listHoliday(@RequestParam("startDay") LocalDate startDay, @RequestParam("endDay") LocalDate endDay);
}

